import Vue from 'vue'
import VueRouter from 'vue-router'
import App from './App.vue'
import router from './router'
import store from './store'
import Storage from 'vue-ls'
import './utils/rem'

import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'

import '@/icons' // icon
import '@/permission'
import './assets/iconfont/iconfont.css'
import './views/default/tools'

import 'video.js/dist/video-js.css'
import 'video.js'
import 'videojs-flash'

import { fabric } from 'fabric'

import '@mapgis/webclient-vue-ui/dist-libs/webclient-vue-ui.css'
import '@mapgis/webclient-vue-cesium/dist-libs/webclient-vue-cesium.css'

import MapgisUi from '@mapgis/webclient-vue-ui'
import Mapgis3d from '@mapgis/webclient-vue-cesium'

import szkstool from 'szkstool'
import 'szkstool/lib/styles/szkstool.css'

import CodeView from 'vue-code-view'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

Vue.use(Antd)
Vue.use(MapgisUi)
Vue.use(Mapgis3d)
Vue.use(fabric)
Vue.use(szkstool)
Vue.use(CodeView)
Vue.use(ElementUI)
szkstool.resister(store)

// import * as fundebug from 'fundebug-javascript'
// import FundebugVue from 'fundebug-vue'
// fundebug.apikey = '0d6b06c2149816c458d9affda6f1aa880b53b5536a53983492412a6dade1cbb4'
// new FundebugVue(fundebug).installVueErrorHandler(Vue) // Vue 2.x

// if (process.env.NODE_ENV === 'development') {
//   const { mockXHR } = require('../mock')
//   mockXHR()
// }
const { mockXHR } = require('../mock')
mockXHR()

Vue.config.productionTip = false
Vue.prototype.$map3DUtils = szkstool.map3DUtils

// 当前环境入口
Vue.prototype.$env = {
  entry: process.env.VUE_APP_ENTRY,
}

const options = {
  namespace: 'vuejs__', // key键前缀
  name: 'ls', // 命名Vue变量.[ls]或this.[$ls],
  storage: 'session', // 存储名称: session, local, memory
}

Vue.use(Storage, options)
Vue.use(VueRouter)

new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
